MAKE_PATH = js/src
WORK_PATH = js/

COFFEE = $(wildcard ${MAKE_PATH}/*.coffee)
CFJS = $(patsubst %.coffee,%.js,$(COFFEE))
JS=$(find $(MAKE_PATH) -name '*.js')

all: $(COFFEE)
	coffee -bc $(COFFEE)
	mv $(CFJS) $(WORK_PATH)

install: 
	find $(WORK_PATH) -name '*.js' -not -name '*.min.js' \
		| while read line ; \
	do\
		echo compressing $$line ;\
		new=$$(echo $$line | sed 's/\.js/\.min\.js/g');\
		uglifyjs $$line > $$new; \
	done
	
	
